package com.centaline.androidsalesblog.activities.sale;

import android.support.v7.widget.AppCompatTextView;

import com.centaline.androidsalesblog.R;
import com.centaline.androidsalesblog.activities.ImgListBrowseActivity;
import com.centaline.androidsalesblog.model.businissobject.PostImgBo;

import java.util.ArrayList;

/**
 * 租售图片列表浏览
 * Created by guilin on 16/1/31.
 */
public class PostImgListBrowseActivity extends ImgListBrowseActivity {

    public static final String POST_IMG_LIST = "POST_IMG_LIST";

    private AppCompatTextView atv_des1, atv_des2;

    private ArrayList<PostImgBo> postImgBos;

    @Override
    protected int setLayoutId() {
        return R.layout.activity_post_img_list_browse;
    }

    @Override
    protected void findViews() {
        super.findViews();
        atv_des1 = (AppCompatTextView) findViewById(R.id.atv_des1);
        atv_des2 = (AppCompatTextView) findViewById(R.id.atv_des2);
    }

    @Override
    protected void initViews() {
        postImgBos = getIntent().getParcelableArrayListExtra(POST_IMG_LIST);
        super.initViews();
    }

    @Override
    protected void pageSelected(int position) {
        super.pageSelected(position);
        if (postImgBos != null && postImgBos.size() > position) {
            final PostImgBo postImgBo = postImgBos.get(position);
            atv_des1.setText(postImgBo.getDescription());
        }
    }
}
